package com.flower.enjoyment.flower.service.impl;

import com.flower.enjoyment.flower.entityDo.PresentDetailDo;
import com.flower.enjoyment.flower.mapper.PresentDetailMapper;
import com.flower.enjoyment.flower.service.PresentDetailService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PresentDetailServiceImpl implements PresentDetailService {

    @Autowired
    private PresentDetailMapper presentDetailMapper;
    /**
     * 分页查询赠送信息
     *
     * @param pageNo
     * @param pageSize
     * @param userId
     * @return
     */
    @Override
    public Page<PresentDetailDo> selectPresentDetailByPage(Integer pageNo, Integer pageSize, String userId) {
        PageHelper.startPage(pageNo, pageSize);
        return presentDetailMapper.selectPresentDetailByPage(userId);
    }

    @Override
    public PresentDetailDo selectPresentDetailByCardId(String cardId) {
        return presentDetailMapper.selectPresentDetailByCardId(cardId);
    }
}
